home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / dev / e / rpmod1v1.lha / Modules / Tools / bcpl.doc next >
Encoding:
Text File  |  1995-04-06  |  1.4 KB  |  61 lines

  1.  
  2.     BCPL support functions (bcpl.e)
  3.  
  4.     © Richard Perrott 6th April 1995 FreeWare
  5.       email: hcm94rp2@dmu.ac.uk
  6.  
  7. This module contains the following functions:
  8.  
  9.     PROC bptr(bptr)
  10.     PROC cptr(cptr)
  11.     PROC bstr(bptr, dst=0, len=ALL)
  12.     PROC bstrc(cptr, dst=0, len=ALL)
  13.     PROC bstrCmp(bptr1, bptr2, len=ALL)
  14.     PROC bstrCmpc(cptr1, cptr2, max=ALL)
  15.  
  16.  
  17.     Usage:
  18.  
  19. PROC bptr(bptr)
  20.  
  21.     converts a BPTR to a CPTR
  22.  
  23.  
  24. PROC cptr(cptr)
  25.  
  26.   converts a CPTR to a BPTR, if the CPTR is not on a longword
  27. boundary it does Raise("CPTR")
  28.  
  29.  
  30. PROC bstr(bptr:BPTR, dstring=NIL, len=ALL)
  31. PROC bstrc(cptr:CPTR, dstringt=NIL, len=ALL)
  32.  
  33.   Both PROCs convert a BSTR (BCPL string) into a C string.
  34. If an address is not provided for a destination string in
  35. dstring' then a string is allocated using String().
  36. Raise("MEM") is called if String() returns NIL.
  37.  
  38.  
  39. PROC bstrCmp(bptr1:BPTR, bptr2:BPTR, max=ALL)
  40. PROC bstrCmpc(cptr1:CPTR, cptr2:CPTR, max=ALL)
  41.  
  42.   Both PROCs compare a two BSTRs (BCPL strings).
  43. Only max chars are compared.
  44. Returns 0 if string1=string2
  45. Returns -1 if string1<string2
  46. Returns 1 if string1>string2
  47.  
  48.  
  49. Note:
  50.   Any registers used by these routines are saved.
  51.  
  52.   The module contains 288 bytes of assembler / E code.
  53.  
  54.   All the routines will stay in a 68020+ code cache.
  55.  
  56.   The routine has been heavily tested, though there are no promises
  57. and I won't be held responsible if you find bugs or you misuse the
  58. routine.
  59.  
  60.   If you do find any bugs then please email me.
  61.